//
//  PeiSongSetTiXianPassVController.m
//  Experss
//
//  Created by 嗯，大葱 on 17/8/14.
//  Copyright © 2017年 嗯，大葱. All rights reserved.
//

#import "PeiSongSetTiXianPassVController.h"
#import "PersonTwoCell.h"
#import "SetPayPasswordVController.h"
#import "YanZhengPhoneVController.h"
@interface PeiSongSetTiXianPassVController ()<UITableViewDelegate, UITableViewDataSource>

@property (nonatomic, strong)UITableView *tableView;

@end

@implementation PeiSongSetTiXianPassVController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self configureNaBar];
    [self configureViewC];
}
- (void)configureNaBar {
    self.navigationItem.title = @"提现密码";
    //设置导航栏按钮的边距
    UIButton * rightBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    rightBtn.frame= CGRectMake(0, 0, 60, 30);
    [rightBtn setImage:[UIImage imageNamed:@"all_fanhui2"] forState:(UIControlStateNormal)];
    [rightBtn addTarget:self action:@selector(handleBackAxtion) forControlEvents:UIControlEventTouchUpInside];
    
    UIBarButtonItem *btn_left = [[UIBarButtonItem alloc] initWithCustomView:rightBtn];
    UIBarButtonItem *negativeSpacerleft = [[UIBarButtonItem alloc]   initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace   target:nil action:nil];
    /**
     width为负数时，相当于btn向右移动width数值个像素，由于按钮本身和  边界间距为5pix，所以width设为-5时，间距正好调整为0；width为正数 时，正好相反，相当于往左移动width数值个像素
     */
    negativeSpacerleft.width = -20;
    self.navigationItem.leftBarButtonItems = [NSArray arrayWithObjects:negativeSpacerleft, btn_left, nil];
    
    
    
}



//配置视图控制器
- (void)configureViewC {
    _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, kScreen_Width, kScreen_Height) style:(UITableViewStylePlain)];
    _tableView.dataSource = self;
    _tableView.delegate = self;
    _tableView.separatorStyle = kSpNone;
    _tableView.backgroundColor = KShouYeBg;
    _tableView.scrollEnabled = NO;
    [self.view addSubview:_tableView];
    
    [self.tableView registerNib:[UINib nibWithNibName:@"PersonTwoCell" bundle:nil] forCellReuseIdentifier:@"PersonTwoCell"];
}


-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 2;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    
    return 1;
    
    
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    return 60;
    
}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
    
    return 10;
    
}
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
    UIView *bgV = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreen_Width, 10)];
    bgV.backgroundColor = KShouYeBg;
    return bgV;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    PersonTwoCell *cell = [tableView dequeueReusableCellWithIdentifier:@"PersonTwoCell"];
    cell.selectionStyle = kSeNone;
    
    if (indexPath.section == 0) {
        cell.titleLB.text = @"设置提现密码";
        cell.jiantouV.hidden = NO;
        cell.liJiSheZhiLB.hidden = YES;
        
    }
    if (indexPath.section == 1) {
        cell.titleLB.text = @"忘记提现密码";
        cell.jiantouV.hidden = NO;
        cell.liJiSheZhiLB.hidden = YES;
    }
    return cell;
    
    
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    
    if (indexPath.section == 0) {
        YanZhengPhoneVController *yan= [[YanZhengPhoneVController alloc] init];
        yan.pushTypeStr = @"提现密码";
        [self.navigationController pushViewController:yan animated:YES];
    }
    if (indexPath.section == 1) {
        SetPayPasswordVController *se = [[SetPayPasswordVController alloc] init];
        [self.navigationController pushViewController:se animated:YES];
    }
    
    
    
    
}

- (void)handleBackAxtion {
    [self.navigationController popViewControllerAnimated:YES];
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end

